<?php

namespace App\Models\SiteLocation;

use App\Models\BaseModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class CityShopFirstOrderPriceModel extends BaseModel
{
    use HasFactory;

    protected $table      = 'city_shop_first_order_price';
    public    $timestamps = false;
    protected $fillable   = [
        'id',
        'city',
        'cityCode',
        'price',
    ];

    public static function getPrice($cityCode): int
    {
        $price = (int)self::query()
            ->where('cityCode', $cityCode)
            ->value('price');

        return $price ?: 20000;

    }


}
